Skip to content

Conversation

wilczman
Copy link

@wilczman wilczman commented Sep 18, 2025

Summary

Fixes two major performance bottlenecks in pseudo_inverse_stacked() that impact computation time for medium to large matrices.

Changes

  • Fix double computation: Remove duplicate AAt = Adot.values @ Adot.values.T on lines 37-38
  • Optimize eigenvalue calculation: Replace full eigendecomposition with matrix 2-norm np.linalg.eig(AAt)[0][0].realnp.linalg.norm(AAt, ord=2)

Related Issues

Addresses performance concerns with large sensitivity matrices in inverse problem solving.

…in pseudo_inverse_stacked

- Remove duplicate AAt matrix multiplication (lines 37-38)
- Replace full eigendecomposition with matrix 2-norm for largest eigenvalue
- Expected improved performance (for me it was 20%-40% less time for computation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant